library BattalionCommand initializer init requires LegacySystem

	private function BattalionCommand takes nothing returns nothing
		local string s = SubString(GetEventPlayerChatString(),5,StringLength(GetEventPlayerChatString()))
		if s=="zugzug" then
			set udg_soundpath = "Sound\\Music\\mp3Music\\War2IntroMusic.mp3"
			call PlaySoundPath.execute()
		elseif s=="girl" then
			if GetRandomInt(0,2)==1 then
				set udg_soundpath = "Sound\\Dialogue\\HumanCampaign\\Human01\\H01VillagerF39.mp3"
			elseif GetRandomInt(0,1)==1 then
				set udg_soundpath = "Sound\\Dialogue\\HumanCampaign\\Human01\\H01VillagerF40.mp3"
			else
				set udg_soundpath = "Sound\\Dialogue\\HumanCampaign\\Human01\\H01VillagerF41.mp3"
			endif
			call PlaySoundPath.execute()
		else
			call GeneralText(12.0, "|cffcd950cBattalion|r : " + SubStringBJ(GetEventPlayerChatString(), 6, StringLength(GetEventPlayerChatString())) )
		endif
	endfunction

	private function init takes nothing returns nothing
		local trigger t = CreateTrigger()
		local integer i = 0

		loop
			exitwhen i > 11
			call TriggerRegisterPlayerChatEvent(t, Player(i), "-dad", false)
			set i = i + 1
		endloop

		call TriggerAddAction(t,function BattalionCommand)
	endfunction

endlibrary
